#! /bin/sh

dir=`dirname $0`

$dir/../../tests/filter_stderr_basic                |

# Remove "Cachegrind, ..." line and the following copyright line.
sed "/^Cachegrind, a high-precision tracing profiler/ , /./ d" |

# Remove numbers from I/D/LL "refs:" lines
perl -p -e 's/((I|D|LL) *refs:)[ 0-9,()+rdw]*$/\1/'  |

# Remove numbers from I1/D1/LL/LLi/LLd "misses:" and "miss rates:" lines
perl -p -e 's/((I1|D1|LL|LLi|LLd) *(misses|miss rate):)[ 0-9,()+rdw%\.]*$/\1/' |

# Remove CPUID warnings lines for P4s and other machines
sed "/warning: Pentium 4 with 12 KB micro-op instruction trace cache/d" |
sed "/Simulating a 16 KB I-cache with 32 B lines/d"   |
sed "/warning: L3 cache found, using its data for the LL simulation./d" |
sed "/warning: L4 cache found, using its data for the LL simulation./d" |
sed "/Warning: Cannot auto-detect cache config, using defaults./d" |
sed "/Run with -v to see./d" |
sed "/warning: specified LL cache: line_size .*$/d" |
sed "/warning: simulated LL cache: line_size .*$/d"

